<h1><%= l(:rate_label_new_rate) %></h1>

<% @rate = Rate.new(:user => @user ) %>
<% @back_url = url_for(:controller => 'users', :action => 'edit', :id => @user, :tab => 'rates') %>
<%= render :partial => 'rates/form' %>

<div id="rate_history">
<h1><%= l(:rate_label_rate_history) %></h1>
<%# TODO: Refactor out of the view once there is a hook in the controller (Post 0.8.0). %>
<%# Can't expect everyone to upgrade at the moment %>
<% sort_init "#{Rate.table_name}.date_in_effect", "desc" %>
<% sort_update RatesController::ValidSortOptions %>

<% @rates = Rate.history_for_user(@user, "#{Rate.table_name}.date_in_effect desc") %>

<%= render :partial => 'rates/list' %>
</div>
